        <script>
          var markers = {};
          var map;
          function initMap() {
            var bounds = new google.maps.LatLngBounds();
            var centroid = new google.maps.LatLng(enodebs[0].trilat[0], enodebs[0].trilat[1]);
            var map = new google.maps.Map(document.getElementById('map'), {
              center: centroid,
              zoom: 15
            });

            var points = [];
            var opacity = 0.2
            for (const t of known_towers) {
                var point = new google.maps.LatLng(t.lat, t.lon);
                new google.maps.Marker({position: point, map: map, title: t.description,
                  icon: "{{ url_for('static', filename='tower.png') }}"
                });
            }

            for(const enb of enodebs){
              var m = addMarker(enb)
              markers[enb[key]] = m
            }

            function addMarker(enb) {
                let lat = enb.trilat[0]
                let lon = enb.trilat[1]
                var point = new google.maps.LatLng(lat, lon);
                bounds.extend(point);
                let marker = new google.maps.Marker({
                  position: point, map: map, title: enb[key].toString()
                });
                if(enb.max_suspiciousness >= 30){
                  marker.setIcon("{{ url_for('static', filename='skull.png') }}");
                }


                marker.addListener("click", function (e) {
                  openInfoWindow(enb, map, marker);  // change the map variable appropriately
                });
                return marker;
            }

            map.fitBounds(bounds);

            // Create and open singleton infowindow object
            var s_infowindow = new google.maps.InfoWindow({});
            function openInfoWindow(enb, map, marker){
                let boxText = document.createElement("div");
                let header;
                if(key == 'enodeb_id') {
                  header = `
                  <table>
                    <tr>
                      <th scope="row">ENodeB ID</th>
                      <td><a href="/enb_detail/${enb.enodeb_id}">${enb.enodeb_id}</a></td>
                    </tr>
                    <tr>
                      <th scope="row">Sightings</th>
                      <td>${enb.sightings}</td>
                    </tr>
                  `
                } else {
                  header = `
                  <table>
                    <tr>
                      <th scope="row">Cell ID</th>
                      <td><a href="/cid_detail/${enb.cid}">${enb.cid}</a></td>
                    </tr>
                    `
                }

                boxText.innerHTML = header + `
                  <tr>
                    <th scope="row">PLMN</th>
                    <td>${enb.plmn}</td>
                  </tr>
                  <tr>
                    <th scope="row">Closest Tower</th>
                    <td>${Math.round(enb.closest_tower)}M</td>
                  </tr>
                  <tr>
                    <th scope="row">Unique Cells</th>
                    <td>${enb.unique_cells}</td>
                  </tr>
                  <tr>
                    <th scope="row">Suspicious Cells</th>
                    <td>${enb.max_suspiciousness}%</td>
                  </tr>
                  <tr>
                    <th scope="row">First Seen</th>
                    <td>${enb.first_seen}</td>
                  </tr>
                  <tr>
                    <th scope="row">Last Seen</th>
                    <td>${enb.last_seen}</td>
                  </tr>
                  `
                boxText.style.cssText = "color: black; margin-top: 8px; padding: 5px;";

                let  myOptions = {
                  content: boxText
                  //,position: new google.maps.LatLng(enb.trilat[0], enb.trilat[1])
                  ,disableAutoPan: false
                  ,zIndex: null
                  ,boxStyle: {
                    background: "url('tipbox.gif') no-repeat"
                    ,opacity: 0.75
                    ,width: "280px"
                  }
                  ,closeBoxMargin: "10px 2px 2px 2px"
                  ,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif"
                  ,infoBoxClearance: new google.maps.Size(1, 1)
                  ,isHidden: false
                  ,pane: "floatPane"
                  ,enableEventPropagation: false
                };

                s_infowindow.setOptions(myOptions);
                s_infowindow.open(map, marker);  // change the map variable appropriately
          }
        }
        </script>
